Fix read of non-initialized clip_region
authorAlexander Larsson <alexl@redhat.com>
Sat, 18 Jul 2009 19:56:03 +0000 (21:56 +0200)
committerAlexander Larsson <alexl@redhat.com>
Sat, 18 Jul 2009 21:15:57 +0000 (23:15 +0200)
Foreign children are always viewable but may not have a viewable
parent, so ensure we don't read the parent for them.

gdk/gdkwindow.c

index 10fc70adb34b5b09c3b692cba78221aab785ca7e..eeb89325b3e1735ac614eb39767edfe89337de13 100644 (file)
@@ -783,7 +783,12 @@ recompute_visible_regions_internal (GdkWindowObject *private,
       r.height = private->height;
       new_clip = gdk_region_rectangle (&r);
 
-      if (private->parent != NULL && private->parent->window_type != GDK_WINDOW_ROOT)
+      if (private->parent != NULL &&
+         private->parent->window_type != GDK_WINDOW_ROOT &&
+         /* For foreign children, don't remove local parents, as parent
+            may not be mapped yet, and the non-native parents are not really
+            enforced for it anyways. */
+         private->window_type != GDK_WINDOW_FOREIGN)
        {
          gdk_region_intersect (new_clip, private->parent->clip_region);